import request from '@/utils/request'

export default {
  // 服务器列表
  getServerList(data) {
    const url = 'console/equipmentServer/list'
    return request.get(url, data)
  },
  // 新增服务器
  addServer(data) {
    const url = 'console/equipmentServer'
    return request.put(url, data)
  },
  // 修改服务器
  updateServer(data) {
    const url = 'console/equipmentServer'
    return request.put(url, data)
  },
  // 删除服务器
  deleteServer(data) {
    const url = 'console/equipmentServer'
    return request.delete(url, data)
  },
  // 批量删除服务器
  deleteMultiServer(data) {
    const url = 'console/equipmentServer/batchDeleteByIds/' + data
    return request.delete(url)
  },
  // 服务器详情
  getServerDetail(data) {
    const url = 'console/equipmentServer/' + data
    return request.get(url)
  },
  // 网格列表
  getGridTree() {
    const url = 'main/grid/tree'
    return request.get(url)
  },
  // 部门列表
  getDeptTree() {
    const url = 'system/dept'
    return request.get(url)
  },
  // 传输设备列表
  getTransList(data) {
    const url = 'console/equipmentTransoport/list'
    return request.get(url, data)
  },
  // 传输设备详情
  getTransDetail(data) {
    const url = 'console/equipmentTransoport/' + data
    return request.get(url)
  },
  // 新增传输设备
  addTrans(data) {
    const url = 'console/equipmentTransoport'
    return request.post(url, data)
  },
  // 修改传输设备
  updateTrans(data) {
    const url = 'console/equipmentTransoport'
    return request.put(url, data)
  },
  // 删除传输设备
  deleteTrans(data) {
    const url = 'console/equipmentTransoport'
    return request.delete(url, data)
  },
  // 批量删除传输设备
  deleteMultiTrans(data) {
    const url = 'console/equipmentTransoport/batchDeleteByIds/' + data
    return request.delete(url)
  },
  // 协议类型数据字典
  protocolType(data) {
    const url = 'system/dict/getDictValueAttr'
    return request.get(url, data)
  },
  // 消防主机列表
  getFireMainList(data) {
    const url = 'console/equipmentHost/list'
    return request.get(url, data)
  },
  // 新增消防主机
  addFireMain(data) {
    const url = 'console/equipmentHost'
    return request.post(url, data)
  },
  // 修改消防主机
  updateFireMain(data) {
    const url = 'console/equipmentHost'
    return request.put(url, data)
  },
  // 消防主机详情
  getFireMainDetail(data) {
    const url = 'console/equipmentHost/' + data
    return request.get(url)
  },
  // 删除消防主机
  deleteFireMain(data) {
    const url = 'console/equipmentHost'
    return request.delete(url, data)
  },
  // 批量删除消防主机
  deleteMultiFireMain(data) {
    const url = 'console/equipmentHost/batchDeleteByIds/' + data
    return request.delete(url)
  },
  // 消防采集列表
  getFireCollectList(data) {
    const url = 'main/equipment/list'
    return request.get(url, data)
  },
  // 新增消防采集
  addFireCollect(data) {
    const url = 'main/equipment'
    return request.postJson(url, data)
  },
  // 修改消防采集
  updateFireCollect(data) {
    const url = 'main/equipment'
    return request.putJson(url, data)
  },
  // 消防采集详情
  getFireCollectDetail(data) {
    const url = 'main/equipment/model'
    return request.get(url, data)
  },
  // 删除消防采集
  deleteFireCollect(data) {
    const url = 'main/equipment/' + data
    return request.delete(url)
  },
  // 采集设备类型字典列表
  getCollectTypeList() {
    const url = 'system/dict/getDictValueAttr?fieldName=collect_type&tableName=t_equipment_collect&'
    return request.get(url)
  },
  // 采集设备编码查重
  deviceCodeCheck(data) {
    const url = 'console/equipmentCollect/checkDeviceCodeDumplicate'
    return request.get(url, data)
  }
}
